package com.ofek.eventos.db.datatypes.helptypes;

import java.io.Serializable;

import com.ofek.applicationbase.forms.FormField;
import com.ofek.base.db.DataField;
import com.ofek.base.db.DataTypeClass;
@DataTypeClass
public class EventInfo implements Serializable {
	@DataField(isKey = true)
	@FormField
	public long eid;
	@DataField(isKey = true,references = UserInfo.class, referenceField = "uid")
	@FormField
	public int eidOwner;
	@DataField(isKey = true)
	@FormField
	public long ts;
	@DataField(isKey = true,references = UserInfo.class, referenceField = "uid")
	@FormField
	public int tsOwner;


	@DataField(references = UserInfo.class, referenceField = "uid")
	@FormField
	public int uid_owner;
	@DataField(references = TypeInfo.class, referenceField = "tid")
	@FormField
	public long tid;
	@DataField(references = UserInfo.class, referenceField = "uid")
	@FormField
	public int uid_creator;


	public EventInfo(final long order_ts,final int eidOwner,final long eid, final long tid,final int uid_owner,final int uid_creator, final long ts,final int tsOwner,final boolean removed,final boolean confirmed) {
		this.eid = eid;
		this.tid = tid;
		this.uid_creator = uid_creator;
		this.uid_owner = uid_owner;
		this.ts = ts;
		this.tsOwner = tsOwner;
		this.eidOwner=eidOwner;
	}

	public EventInfo(final int eidOwner,final long eid,final int tsOwner,final long ts) {
		this.eid = eid;
		this.ts = ts;
		this.tsOwner = tsOwner;
		this.eidOwner=eidOwner;
	}

	public EventInfo() {
	}
	@Override
	public boolean equals(final Object obj) {
		final boolean equals = super.equals(obj);
		if (equals) return true;
		if (!(obj instanceof EventInfo)) return false;
		final EventInfo other = (EventInfo)obj;
		return other.eid==eid && other.ts==ts && other.tsOwner==tsOwner && other.eidOwner==eidOwner;

	}


}
